<template>
  <div class="dialog-container">
    <el-dialog :visible.sync="showAdd" width="50%" :title="titles[btnType]" :before-close="handleClose">

      <el-form :model="form" label-width="120px">
        <el-form-item>
          <span slot="label">
						<must/><span>关键字 </span>
          </span>
          <el-input v-model="form.conKey" v-validate="'required|max:200'" name="关键字" placeholder="请输入关键字" />
          <span v-show="errors.has('关键字')" style="color: red;">{{ errors.first('关键字') }}</span>
        </el-form-item>
        <el-form-item>
          <span slot="label">
						<must/><span>值 </span>
          </span>
          <el-input v-model="form.conValue" v-validate="'required|max:500'" name="值" type="textarea" :rows="2" placeholder="请输入值"></el-input>
          <span v-show="errors.has('值')" style="color: red;">{{ errors.first('值') }}</span>
        </el-form-item>
        <el-form-item>
          <span slot="label">
						<span>描述 </span>
          </span>
          <el-input v-model="form.conDesc" v-validate="'max:500'" name="描述" type="textarea" :rows="2" placeholder="请输入描述"></el-input>
        </el-form-item>
        <el-form-item label="状态">
          <el-radio-group v-model="form.conStatus" name="状态" v-validate="'required'" >
            <el-radio-button v-for="(val, key) in allDictData.statusOps" :label="key" :key="key">{{val}}
            </el-radio-button>
          </el-radio-group>
        </el-form-item>
      </el-form>
      <div slot="footer">
        <el-button @click="handleClose" type="danger">关 闭</el-button>
        <el-button @click="handleSave" type="primary" :disabled="btnDisabled">保 存</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
  /* mixins */
  import addUpdateMixin from '@/mixins/addUpdate/addUpdateMixin.js'

  export default {
    /* 常量管理 - 添加 修改页面  */
    name: 'constant-add',
    data() {
      return {
        form: {
          uuid: '',
          conKey: '',
          conValue: '',
          conDesc: '',
          conStatus: 1,
        },
      }
    },
    mixins: [addUpdateMixin],
    props: ['allDictData'],
    methods: {

    } // methods end
  }
</script>

<style scoped>
  @import "~@/styles/form.css";
</style>
